One day, one person, one project
Features ยท Quick Start ยท Documentation ยท ไธญๆๆๆกฃ
Track nutrition, exercise, and wellness with AI-powered personalized insights
Important: Please ensure you're using the latest security-patched versions:
- Next.js:
16.0.10+or16.1.x(CVE-2025-66478)- React:
19.2.3+(CVE-2025-55182, CVE-2025-55183, CVE-2025-55184)Run
npm auditregularly and keep dependencies updated.
| Feature | Description |
|---|---|
| ๐ฝ๏ธ Smart Food Logging | AI-powered food recognition with automatic nutrition calculation |
| โ๏ธ Body Metrics | Track weight, BMI, body fat percentage, and fitness progress |
| ๐๏ธ Workout Tracking | Log exercises with duration, calories burned, and intensity |
| ๐ฌ Ingredient Analysis | Scan and analyze food ingredients for health insights |
| ๐ Analytics Dashboard | Visualize trends with interactive charts and statistics |
| ๐ค AI Health Assistant | Get personalized nutrition and fitness recommendations |
| ๐ฑ Mobile-First Design | Responsive UI optimized for all devices |
| ๐ Secure Authentication | JWT-based auth with token refresh mechanism |
| Technology | Version | Description |
|---|---|---|
| Next.js | 16.1.x |
React framework with App Router & Turbopack |
| React | 19.2.x |
UI library with Actions & Server Components |
| TailwindCSS | 4.x |
Utility-first CSS (CSS-first config) |
| Zustand | 5.x |
Lightweight state management |
| TanStack Query | 5.x |
Server state management |
| Radix UI | latest |
Accessible UI primitives |
| Technology | Version | Description |
|---|---|---|
| FastAPI | 0.115+ |
High-performance Python web framework |
| PostgreSQL | 15+ |
Relational database |
| SQLAlchemy | 2.0 |
Async ORM |
| Alembic | 1.14+ |
Database migrations |
| Pydantic | 2.x |
Data validation |
| OpenAI API | GPT-4 |
AI integration |
| Tool | Version | Installation |
|---|---|---|
| Python | 3.11+ | python.org |
| Node.js | 20+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| uv | Latest | curl -LsSf <https://astral.sh/uv/install.sh> | sh |
| Docker | Latest | docker.com |
# Clone and enter directory
git clone <https://github.com/staruhub/Healthapp.git> && cd Healthapp
# Start database
docker-compose up -d
# Terminal 1: Backend
cd backend && cp .env.example .env
uv sync && uv run alembic upgrade head
uv run uvicorn app.main:app --reload --port 8001
# Terminal 2: Frontend
cd frontend && echo "NEXT_PUBLIC_API_URL=http://localhost:8001" > .env.local
pnpm install && pnpm dev
๐ Access the app:
- ๐ Frontend: http://localhost:3000
- ๐ API Docs: http://localhost:8001/docs
# Database
DATABASE_URL=postgresql+asyncpg://healthapp:healthapp_dev_2024@localhost:5432/healthapp_db
# Security (REQUIRED: openssl rand -hex 32)
SECRET_KEY=your-super-secret-key-here
# AI Mode: "mock" (dev) | "real" (prod)
AI_MODE=mock
OPENAI_API_KEY=sk-... # Required when AI_MODE=real
# CORS
CORS_ORIGINS=["<http://localhost:3000>"]
NEXT_PUBLIC_API_URL=http://localhost:8001
NEXT_PUBLIC_AI_MODE=mock
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/v1/auth/register |
User registration |
POST |
/api/v1/auth/login |
User login |
POST |
/api/v1/auth/refresh |
Refresh access token |
GET |
/api/v1/food/logs |
Get food logs |
POST |
/api/v1/food/parse |
AI food parsing |
GET |
/api/v1/body/logs |
Get body metrics |
GET |
/api/v1/dashboard/summary |
Dashboard data |
POST |
/api/v1/chat |
AI chat assistant |
Interactive documentation available at:
- Swagger UI:
GET /docs - ReDoc:
GET /redoc - Health Check:
GET /health
Healthapp/
โโโ backend/ # FastAPI Backend
โ โโโ app/
โ โ โโโ api/v1/ # API Routes
โ โ โ โโโ auth.py # Authentication
โ โ โ โโโ food.py # Food logging
โ โ โ โโโ body.py # Body metrics
โ โ โ โโโ workout.py # Workout tracking
โ โ โ โโโ dashboard.py # Dashboard
โ โ โ โโโ chat.py # AI chat
โ โ โ โโโ ingredient.py # Ingredient analysis
โ โ โโโ models/ # SQLAlchemy Models
โ โ โโโ schemas/ # Pydantic Schemas
โ โ โโโ services/ai/ # AI Service Layer
โ โ โโโ utils/ # Utilities
โ โโโ alembic/ # Database Migrations
โ โโโ pyproject.toml
โ
โโโ frontend/ # Next.js Frontend
โ โโโ app/ # App Router Pages
โ โ โโโ (auth)/ # Auth pages
โ โ โโโ (main)/ # Main app pages
โ โโโ components/ # React Components
โ โ โโโ ui/ # Base UI
โ โ โโโ chat/ # Chat components
โ โ โโโ onboarding/ # Onboarding flow
โ โโโ hooks/ # Custom React Hooks
โ โโโ store/ # Zustand State
โ โโโ lib/ # Utilities
โ โโโ types/ # TypeScript Types
โ
โโโ openspec/ # Project Specifications
โโโ docker-compose.yml
โโโ README.md
Database Connection Failed
# Check container status
docker ps | grep postgres
# Restart container
docker-compose restart
# View logs
docker-compose logs postgres
Port Already in Use
# Find process
lsof -i :8001
# Kill process
kill -9 <PID>
# Or use different port
uv run uvicorn app.main:app --reload --port 8002
Frontend Cannot Connect to Backend
- Verify backend:
curl <http://localhost:8001/health> - Check
NEXT_PUBLIC_API_URLin.env.local - Verify CORS settings in backend
.env - Clear browser cache and restart
Token/Authentication Issues
# Clear stored tokens in browser
localStorage.removeItem('auth-storage')
# Then refresh the page
What is AI_MODE?
mock: Returns pre-defined responses (no API costs, for development)real: Uses OpenAI GPT-4 API (requiresOPENAI_API_KEY)
How to reset the database?
dropdb healthapp_db && createdb healthapp_db
cd backend && uv run alembic upgrade head
How to generate a secure SECRET_KEY?
openssl rand -hex 32
- Fork the repository
- Create feature branch:
git checkout -b feature/AmazingFeature - Commit changes:
git commit -m 'feat: add amazing feature' - Push to branch:
git push origin feature/AmazingFeature - Open Pull Request
| Type | Description |
|---|---|
feat |
New feature |
fix |
Bug fix |
docs |
Documentation |
style |
Formatting |
refactor |
Code refactoring |
test |
Adding tests |
chore |
Maintenance |
This project is licensed under the MIT License - see LICENSE for details.
็นๅปๅฑๅผไธญๆ่ฏดๆ
- ๐ฝ๏ธ ๆบ่ฝ้ฃ็ฉ่ฎฐๅฝ - AI ้ฉฑๅจ็้ฃ็ฉ่ฏๅซ๏ผ่ชๅจ่ฎก็ฎ่ฅๅ ปๆๅ
- โ๏ธ ่บซไฝๆๆ ่ฟฝ่ธช - ่ฟฝ่ธชไฝ้ใBMIใไฝ่็ๅๅฅ่บซ่ฟๅบฆ
- ๐๏ธ ่ฟๅจ่ฟฝ่ธช - ่ฎฐๅฝ่ฟๅจๆถ้ฟใๆถ่ๅก่ทฏ้ๅ่ฟๅจๅผบๅบฆ
- ๐ฌ ๆๅๅๆ - ๆซๆๅๆ้ฃๅ้ ๆ๏ผๆไพๅฅๅบทๆดๅฏ
- ๐ ๆฐๆฎไปช่กจ็ - ไบคไบๅผๅพ่กจๅฏ่งๅๅฅๅบท่ถๅฟ
- ๐ค AI ๅฅๅบทๅฉๆ - ่ทๅไธชๆงๅ่ฅๅ ปๅๅฅ่บซๅปบ่ฎฎ
# ๅ
้ไปๅบ
git clone <https://github.com/staruhub/Healthapp.git> && cd Healthapp
# ๅฏๅจๆฐๆฎๅบ
docker-compose up -d
# ๅฏๅจๅ็ซฏ
cd backend && cp .env.example .env
uv sync && uv run alembic upgrade head
uv run uvicorn app.main:app --reload --port 8001
# ๅฏๅจๅ็ซฏ๏ผๆฐ็ป็ซฏ๏ผ
cd frontend && echo "NEXT_PUBLIC_API_URL=http://localhost:8001" > .env.local
pnpm install && pnpm dev
| ไพ่ต | ็ๆฌ | ๅฎ่ฃ ๆนๅผ |
|---|---|---|
| Python | 3.11+ | python.org |
| Node.js | 20+ | nodejs.org |
| pnpm | 9+ | npm install -g pnpm |
| uv | ๆๆฐ็ | curl -LsSf <https://astral.sh/uv/install.sh> | sh |
| Docker | ๆๆฐ็ | docker.com |
โญ Star this repo if you find it helpful! โญ